package cn.woblog.recyclerviewsample.animator;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import jp.wasabeef.recyclerview.adapters.AnimationAdapter;

/**
 * Created by renpingqing on 2017/4/9.
 */

public class SlideInRightAnimationAdapter extends AnimationAdapter {

  public SlideInRightAnimationAdapter(
      RecyclerView.Adapter adapter) {
    super(adapter);
  }

  /**
   * 从宽度变为0
   */
  @Override
  protected Animator[] getAnimators(View view) {
    return new Animator[]{
        ObjectAnimator.ofFloat(view, "translationX", view.getRootView().getWidth(), 0)
    };
  }
}
